﻿using Might.Infrastructure.DOM;
using Might.Infrastructure.ModelicaDOM.Equations;

namespace Might.Infrastructure.ModelicaDOM {
    
    /// <summary>
    /// Enum representing various types of classes in Modelica
    /// </summary>
    public enum ModelicaClassType {
        /// <summary>
        /// Built in type - string,int,real,bool
        /// </summary>
        Predefined,
        
        /// <summary>
        /// Restricted type - modelica function
        /// </summary>
        Function,
        
        /// <summary>
        /// Restricted type - modelica connector
        /// </summary>
        Connector,
        
        /// <summary>
        /// Restricted type - modelica package
        /// </summary>
        Package,

        /// <summary>
        /// Restricted type - modelica block
        /// </summary>
        Block,
        
        /// <summary>
        /// Restricted type - modelica model
        /// </summary>
        Model,
        
        /// <summary>
        /// Restricted type - modelica record
        /// </summary>
        Record,
        
        /// <summary>
        /// Restricted type - modelica class
        /// </summary>
        Class,
        
        /// <summary>
        /// Restricted type - modelica type
        /// </summary>
        Type,
        
        //TODO Should this be used???
        /// <summary>
        /// Restricted type - modelica enum - 
        /// </summary>
        Enumeration
    }

    /// <summary>
    /// Interface for representing Modelica classes
    /// </summary>    
    [ContainedChild(GroupNames.ModelicaClasses,typeof(IModelicaClass))]
	[ContainedChild(GroupNames.ModelicaPublicComponents,typeof(IComponent ))]
	[ContainedChild(GroupNames.ModelicaProtectedComponents,typeof(IComponent))]
	[ContainedChild(GroupNames.ModelicaPublicInheritanceDeclaration,typeof(IInheritanceDeclaration))]
	[ContainedChild(GroupNames.ModelicaProtectedInheritanceDeclaration,typeof(IInheritanceDeclaration))]
	[ContainedChild(GroupNames.ModelicaProtectedImportDeclaration,typeof(IImportDeclaration))]
    [ContainedChild(GroupNames.ModelicaPublicImportDeclaration, typeof(IImportDeclaration))]
    [ContainedChild(GroupNames.ModelicaInitialEquations, typeof(IEquation))]
    [ContainedChild(GroupNames.ModelicaEquations, typeof(IEquation))]
    [ContainedChild(GroupNames.Annotations,typeof(IDomNode))]
    public interface IModelicaClass {    
        /// <summary>
        /// Name of the Modelica class
        /// </summary>
        string ClassName { get; set; }

        /// <summary>
        /// Fully qualified name of Modelica class
        /// </summary>
        string QualifiedClassName { get; set; }

        /// <summary>
        /// Collection of components of Modelica class
        /// </summary>
        //ObservableCollection<IComponent> Components { get; }

        /// <summary>
        /// Determines the particular restricted type of Modelica class
        /// </summary>
        ModelicaClassType RestrictedType { get; set; }

        /// <summary>
        /// Indicates whether the class is encapsulated or not.
        /// </summary>
        bool Encapsulated { get; set; }
    }
}
